﻿@model Web.Models.MovieListViewModel
           
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/MainSiteLayout.cshtml";
}

<div class="opaqueContent">
    <h2>Filmy</h2>
    
    @if (Model != null)
    {
        <div class="movieFilters">
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, MovieListViewModel.SizeBig, Model.SortBy, Model.ListDirection)' class='@String.Format("{0}", Model.Size == MovieListViewModel.SizeBig ? "selected" : "")'>Kafelki</a>
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, MovieListViewModel.SizeSmall, Model.SortBy, Model.ListDirection)' class='@String.Format("{0}", Model.Size == MovieListViewModel.SizeSmall ? "selected" : "")'>Lista</a>
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, Model.Size, MovieListViewModel.SortByTitle, Model.ListDirection)' class='@String.Format("{0}", Model.SortBy == MovieListViewModel.SortByTitle ? "selected" : "")'>Sortuj według nazwy</a>
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, Model.Size, MovieListViewModel.SortByAddingDate, Model.ListDirection)' class='@String.Format("{0}", Model.SortBy == MovieListViewModel.SortByAddingDate ? "selected" : "")'>Sortuj według daty dodania</a>
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, Model.Size, MovieListViewModel.SortByIssueDate, Model.ListDirection)' class='@String.Format("{0}", Model.SortBy == MovieListViewModel.SortByIssueDate ? "selected" : "")'>Sortuj według daty produkcji</a>
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, Model.Size, Model.SortBy, MovieListViewModel.Ascending)' class='@String.Format("{0}", Model.ListDirection == MovieListViewModel.Ascending ? "selected" : "")'>Rosnąco</a>
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, Model.SelectedKind, Model.Size, Model.SortBy, MovieListViewModel.Descending)' class='@String.Format("{0}", Model.ListDirection == MovieListViewModel.Descending ? "selected" : "")'>Malejąco</a>
            </div>
        
            <div class="movieFilters">
                <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, 0, Model.Size, Model.SortBy, Model.ListDirection)' class='@String.Format("{0}", Model.SelectedKind == 0 ? "selected" : "")'>Wszystkie kategorie</a>
                
                @if (Model.AvailableKinds != null)
                {
                    foreach (MovieKinds kind in Model.AvailableKinds)
                    {
                         <a href='@String.Format("http://{0}/movies/parameters/{1}/{2}/{3}/{4}/1", Request.Url.Host, kind.MovieKindID, Model.Size, Model.SortBy, Model.ListDirection)' class='@String.Format("{0}", Model.SelectedKind == kind.MovieKindID ? "selected" : "")'>@kind.MovieKindName</a>
                    }
                }
            </div>
        
        @Html.Partial("_MovieList", Model) 
    }
    
</div>
